package com.cloudalibabaseataorder10088.controller;

import com.cloudalibabaseataorder10088.service.GoodsService;
import io.seata.spring.annotation.GlobalTransactional;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 * 商品表 前端控制器
 * </p>
 *
 * @author zx
 * @since 2024-12-06
 */
@RestController
@RequestMapping("/goods")
public class GoodsController {

    @Resource
    private GoodsService goodsService;

    /**
     * 新增订单
     */
    @RequestMapping("/add")
    @GlobalTransactional // 全局事务 seata 分布式事务
    public String add() {
        goodsService.add();
        return "新增订单";
    }

}
